package itanty.aop05;

import org.aspectj.lang.ProceedingJoinPoint;

/**
 * @date 2025/9/24
 */
public class AroundAdvice {

    public Object around(ProceedingJoinPoint jp) throws Throwable{
        Object result = null;

        try {
            System.out.println("环绕通知之前置通知");
            //执行目标方法
            result = jp.proceed();
            System.out.println("环绕通知之正常返回通知，返回值为:"+result);
        } catch (Exception e) {
            System.out.println("环绕通知之异常通知，异常为:"+e);
        } finally {
            System.out.println("环绕通知之后置通知");
        }
        return result;
    }
}
